import request from '@/utils/request';

// 获取数据列表
const getDataList = (data) => {
  return request({
    url: `/mockData/dataList`,
    method: 'post',
    data
  });
};

// 消息详情
const getMsgDetail = (data) => {
  return request({
    url: `/${data}`,
    method: 'get'
  });
};

// 上传文件-大文件上传
const uploadFile = (data) => {
  return request({
    headers: {
      repeatSubmit: false
    },
    url: `/admin/attachment/uploadFile`,
    method: 'post',
    data
  });
};

// 上传文件-文件校验
const checkFile = (data) => {
  return request({
    url: `/admin/attachment/checkFileKey/` + data,
    method: 'get'
  });
};

// 上传文件-普通文件上传
const uploadCommon = (url, data) => {
  return request({
    url: url,
    method: 'post',
    data
  });
};

// 上传文件-图片手动上传
const uploadImg = (data) => {
  return request({
    url: '/system/widget/uploadImage',
    method: 'post',
    data
  });
};

// 获取部门树数据
const deptTreeUseSelect = (data) => {
  return request({
    url:'/getDeptTree',
    method:'post',
    data
  })
}

export default {
  getDataList,
  checkFile,
  uploadFile,
  uploadCommon,
  uploadImg,
  deptTreeUseSelect
}